<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			// 逻辑赋值运算符允许你使用逻辑AND (&&=) 和 OR (||=) 运算符进行赋值。
			let a = false;
			let b = true;

			a ||= 1; // a remains false
			b ||= 2; // b remains true
			a &&= 3; // a remains false
			b &&= 4; // b becomes 4

			console.log(a); // Logs "false"
			console.log(b); // Logs "4"
		</script>
	</body>
</html>
